package com.magina.antiPro.redisMQ;

import com.alibaba.fastjson.JSON;
import com.magina.antiPro.model.Members;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

@Slf4j
public class Receiver {
    public String receiveMessage(String message) {
        try{
            List<Members> list = JSON.parseArray(message,Members.class);
            list.stream().forEach(p -> {
                log.info("Received <" + p.toString() + ">");
            });
        }catch (Exception e){
            if(e != null){
                log.info("Received <" + message + ">");
            }
        }
        return message;
    }
}
